<?php
/**
 * Created by 784855684@qq.com.
 * Link: https://github.com/lichtung/wshore
 * User: linzh
 * Date: 6/30/17
 * Time: 4:01 PM
 */
declare(strict_types=1);


namespace application\module\admin\addon\rbca\model;


use application\module\admin\addon\model\AddonModel;

/**
 * Class AccessModel
 *
 * @property string $name 权限名称
 * @property string $value 权限值
 * @property string $type 资源类型，默认为URL('U')
 * @property string $comment 备注
 * @property string $disable 禁用情况
 *
 * @package application\module\admin\addon\rbca\model
 */
class AccessModel extends AddonModel
{

    protected function tableName()
    {
        return 'access';
    }

    protected function struct(): string
    {
        return "  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL COMMENT '权限名称',
  `value` varchar(255) NOT NULL DEFAULT '' COMMENT '权限值',
  `type` char(1) NOT NULL DEFAULT 'U' COMMENT '资源类型，默认为URL(''U'')',
  `comment` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  `disable` tinyint(4) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `title_UNIQUE` (`name`)";
    }

    protected function tablePrefix()
    {
        return 'ws_auth_';
    }
}